package com.jsb.service;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.jsb.mapper.UserDramaMapper;
import com.jsb.model.UserDrama;
import com.jsb.model.UserDramaExample;

@Service
public class UserDramaService{
	
	@Resource
	private UserDramaMapper userDramaMapper;
	
	public void addUserDrama(UserDrama userDrama) {
		userDramaMapper.insertSelective(userDrama);
	}
	
	public void delUserDramaById(String id) {
		userDramaMapper.deleteByPrimaryKey(id);
	}
	
	public void updateUserDrama(UserDrama userDrama) {
		userDramaMapper.updateByPrimaryKeySelective(userDrama);
	}
	
	public void updateUserDramaByExample(UserDrama userDrama,UserDramaExample userDramaExample){
	    userDramaMapper.updateByExampleSelective(userDrama,userDramaExample);
	}
	
	public UserDrama getUserDramaById(String id) {
		return userDramaMapper.selectByPrimaryKey(id);
	}
	
	public List<UserDrama> getPageUserDrama(UserDramaExample userDramaExample) {
		return userDramaMapper.selectPage(userDramaExample);
	}
	
	public int countUserDrama(UserDramaExample userDramaExample) {
		return userDramaMapper.countByExample(userDramaExample);
	}
	
	public List<UserDrama> selectByExample(UserDramaExample example){
	    return userDramaMapper.selectByExample(example);
	}
}
